package com.yxplearn.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxplearn.mybatisplus.mapper.UserRecordMapper;
import com.yxplearn.mybatisplus.pojo.UserRecord;
import com.yxplearn.mybatisplus.service.UserRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Component
public class UserRecordServiceImpl extends ServiceImpl<UserRecordMapper, UserRecord> implements UserRecordService {

    @Autowired
    UserRecordMapper userRecordMapper;

    @Override
    @Transactional(rollbackFor = {RuntimeException.class, Error.class}, propagation = Propagation.NESTED)
    public void saveOne(UserRecord userRecord) {
        userRecordMapper.insert(userRecord);
    }
}
